//
//  Rankinger.swift
//  SLQuickReader
//
//  Created by ALin on 2017/8/14.
//  Copyright © 2017年 ALin. All rights reserved.
//

import UIKit
import ObjectMapper
import SwiftyJSON

class Rankinger: Mappable {
    var id: String?
    var title: String?
    var cover: String? // 图片
    var collapse: Bool = false // 是否进行折叠. 其他榜单要进行折叠
    var monthRank: String? // 月榜
    var totalRank: String? // 总榜
    var shortTitle: String?
    
    required init?(jsonData: JSON) {
        self.id = jsonData["_id"].string ?? ""
        self.title = jsonData["title"].string
        self.cover = jsonData["cover"].string
        self.collapse = jsonData["collapse"].bool ?? false
        self.monthRank = jsonData["monthRank"].string
        self.totalRank = jsonData["totalRank"].string ?? self.id
        self.shortTitle = jsonData["shortTitle"].string
    }
}
